/**
 * Created by qiang on 2017-05-08 .
 */
var self;

var vm = new Vue({
	el: '#app',
	data: {
		userObj: null,
		toOpenId: '',
		provinceList: common.provinceName,

	},
	created: function () {
		self = this
		self.toOpenId = common.getParamsFromURL(window.location).toOpenId
	},
	mounted: function() {
		self.getUserDetail()
	},
	methods: {
		getUserDetail: function () {
			var getUserDetailCallBack = function (res) {
				console.log(res)
				self.userObj = res.userInfo
				self.userObj.birth = res.userOption[147].MyField147
				self.userObj.stature = res.userOption[148].MyField148
				self.userObj.address = common.provinceName[parseInt(res.userInfo.Province) - 1] + common.getCity(parseInt(res.userInfo.Province))[res.userInfo.City]
				$(".loading-bg").hide();
			};
			var options = {
				TaOpenId: self.toOpenId
			};
			service.getUserDetail(options, getUserDetailCallBack)
		},
		formatDate: common.formatDate,
		jumpToMB: function() {
			location.href = 'message_board.html?openid=' + self.toOpenId
		}
	}
})